<?php
/**
 * Created by PhpStorm.
 * User: xujiang
 * Date: 2017/9/23
 * Time: 20:20
 */

$double = function($a) {
    return $a * 2;
};

$numbers = range(1, 5);

print_r($numbers);

$new_numbers = array_map($double, $numbers);

print_r($new_numbers);

print implode(' ', $new_numbers);